package com.tianyang.yukuaifu.module.scrollable;

/**
 * Description：This interface might be used to dynamically compute close-up animation time of a {@link ScrollableLayout}
 * @see ScrollableLayout#setCloseUpIdleAnimationTime(ru.noties.scrollable.CloseUpIdleAnimationTime)
 * @see SimpleCloseUpIdleAnimationTime
 * Created by 薛勇军 on 2018/7/18.
 */

public interface CloseUpIdleAnimationTime {
    /**
     * @param layout {@link ScrollableLayout}
     * @param nowY current scroll y of the *layout*
     * @param endY scroll y value to which *layout* would scroll to
     * @param maxY current max scroll y value of the *layout*
     * @return animation duration for a close-up animation
     */
    long compute(ScrollableLayout layout, int nowY, int endY, int maxY);
}
